﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using CLEXA.DataContracts;

namespace CLEXA.ServiceContracts
{
    [ServiceContract]
    public interface IClientService
    {
        [OperationContract]
        int Login(string username, string password);

        [OperationContract]
        bool ChangePassword(string username, string oldPassword, string newPassword);

        [OperationContract]
        List<DatabaseData> GetDatabasesByUserId(int userId);

        [OperationContract]
        int CreateDatabase(int userId, string connectionString);

        [OperationContract]
        void DeleteDatabase(int databaseId);

        [OperationContract]
        void UpdateDatabase(DatabaseData database);

        [OperationContract]
        DatabaseData GetDatabase(int databaseId);

        [OperationContract]
        List<TableData> GetSchema(string connectionString);

        [OperationContract]
        List<HistogramRowData> ComputeHistograms(string connectionString, QueryData queryData);
    }
}
